//-----------------------------------------------------------------------
// <copyright file="PresenceExtensionFactory.cs" company="Microsoft">
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Microsoft.Live.Messenger.Presence
{
    using System;
    
    /// <summary>
    ///     Factory class that must be derived from in order to add custom presence properties.
    /// </summary>
    public abstract class PresenceExtensionFactory
    {
        /// <summary>
        ///     Deserializes the given content.
        /// </summary>
        /// <param name="name">The name of the custom property</param>
        /// <param name="content">The serialized data</param>
        /// <returns>
        ///     A new <see cref="PresenceExtensionFactory"/>, or <c>null</c> if the property is invalid or unrecognized.
        /// </returns>
        public abstract PresenceExtension Deserialize(
            string name,
            string content);

        /// <summary>
        ///     Serializes the given custom presence property.
        /// </summary>
        /// <param name="property">The property to serialize.</param>
        /// <returns>The serialized content</returns>
        public abstract string Serialize(
            PresenceExtension property);
    }
}